import request from '@/utils/request'

// 查询合同列表
export function listContracts(query) {
  return request({
    url: '/logistics/contracts/list',
    method: 'get',
    params: query
  })
}

// 查询合同详细
export function getContracts(contractId) {
  return request({
    url: '/logistics/contracts/' + contractId,
    method: 'get'
  })
}

// 新增合同
export function addContracts(data) {
  return request({
    url: '/logistics/contracts',
    method: 'post',
    data: data
  })
}

// 修改合同
export function updateContracts(data) {
  return request({
    url: '/logistics/contracts',
    method: 'put',
    data: data
  })
}

// 删除合同
export function delContracts(contractId) {
  return request({
    url: '/logistics/contracts/' + contractId,
    method: 'delete'
  })
}

// 托运人签字
export function shipperSign(contractId) {
  return request({
    url: '/logistics/contracts/shipperSign/' + contractId,
    method: 'post'
  })
}

// 承运人签字
export function carrierSign(contractId) {
  return request({
    url: '/logistics/contracts/carrierSign/' + contractId,
    method: 'post'
  })
}
